import redis


class RedisPackaging():
    rds = redis.Redis(host='127.0.0.1',port=6379)

    # 进行存入
    def add(self,key,val):
        self.rds.set(key,val,ex=60 * 5)

    # 获取
    def gain(self,key):
        gain = self.rds.get(key)
        return gain



